<?php

// +----------------------------------------------------------------------
// | POS机回调
// +----------------------------------------------------------------------
// | Copyright (c) 2015-2024 http://www.yicmf.com, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 微尘 <yicmf@qq.com>
// +----------------------------------------------------------------------

namespace app\controller\api\notify;

use app\common\controller\Base;
use app\event\app\ThirdRecharge as ThirdRechargeEvent;
use think\facade\Log;

class Third extends Base
{


    public function call()
    {
        $param = $this->request->except(['controller', 'action']);
        $event = new ThirdRechargeEvent();
        $re = $event->endPay($param);
        Log::write($re);
        if ($re['code'] == 0) {
            return 'success';
        } else {
            return 'fail';
        }

    }

    public function test()
    {
        $param = [
            'charge_amount' => '0.00',
            'mobile' => '2046022551',
            'order_number' => 'CZH250123336444',
            'otime' => '1737649728',
            'out_trade_num' => '9183884281107M1',
            'remark' => '中燃H5 - 查询燃气账户 - 失败 - 未找到该户对应的成员公司',
            'state' => '2',
            'userid' => '68',
            'voucher' => '',
            'sign' => 'D9A085D89289C8AEFC66FD8F4F821365',
        ];
        $event = new ThirdRechargeEvent();
        $re = $event->endPay($param);
        Log::write($re);
        if ($re['code'] == 0) {
            return 'success';
        } else {
            return 'fail';
        }

    }


}
